﻿<Window x:Class="MalRec.Shell"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:l="clr-namespace:UIControls;assembly=UIControls"
        xmlns:baseControls="clr-namespace:MalRec.Base.Controls;assembly=Malrec.Base"
        Title="MainWindow" Height="350" Width="525">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/MalRec.Base;Component/Resource/Brush.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MalRec.Base;Component/Resource/Style.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MalRec.Base;Component/Resource/Converter.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MalRec.Base;Component/Resource/ControlTemplate.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <Grid>
        <Grid Name="mainGrid">
            <Grid.LayoutTransform>
                <ScaleTransform x:Name="EndOfTheWorldTransformers" />
            </Grid.LayoutTransform>
            <Grid.Resources>
                <Storyboard x:Key="EndOfStory" Name="EndOfStory" Completed="Storyboard_Completed">
                    <DoubleAnimation Storyboard.TargetName="EndOfTheWorldTransformers" Storyboard.TargetProperty="ScaleX" From="1" To="0" Duration="00:00:0.5"  />
                    <DoubleAnimation Storyboard.TargetName="EndOfTheWorldTransformers" Storyboard.TargetProperty="ScaleY" From="1" To="0" Duration="00:00:0.5"  />
                </Storyboard>
            </Grid.Resources>
            <Grid IsEnabled="{Binding IsNotVeryBusy}" Margin="5">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <TabControl SelectedIndex="3">
                    <TabItem x:Name="panelPh" Width="{Binding ActualWidth, ElementName=userPanel}" IsEnabled="False" Focusable="False" Visibility="Hidden" Height="28"/>
                    <TabItem Width="10" IsEnabled="False" Focusable="False" Visibility="Hidden" Height="28"/>
                    <TabItem Header="Animes" Grid.IsSharedSizeScope="True" >
                        zrsgfdgdf
                    </TabItem>
                </TabControl>
                <Border HorizontalAlignment="Left" Margin="0 4 0 0" Height="{Binding ActualHeight, ElementName=panelPh}" VerticalAlignment="Top">
                    <StackPanel VerticalAlignment="Center" x:Name="userPanel" Margin="0 0 0 0" Orientation="Horizontal" Grid.ColumnSpan="2">
                        <TextBox Text="{Binding UserName}" HorizontalAlignment="Left" Margin="0" x:Name="textBox1" Width="135" Padding="2,0" VerticalContentAlignment="Center" />
                        <ComboBox Margin="6,0,0,0" ItemsSource="{Binding SortingMode.Keys}" SelectedItem="{Binding SelectedSortingMode}" Width="150"/>

                        <Button VerticalAlignment="Center" Padding="0" Template="{StaticResource RefreshButtonTemplate}" IsEnabled="{Binding IsNotBusy}" Click="Button_Click_1" Margin="6,0,0,0" Width="{Binding ActualHeight, RelativeSource={RelativeSource Mode=Self}}" />
                    </StackPanel>
                </Border>
                <l:SearchTextBox VerticalContentAlignment="Center" Search="SearchTextBox_Search" Text="{Binding SearchText, Mode=OneWayToSource, UpdateSourceTrigger=PropertyChanged}"  HorizontalAlignment="Right" Margin="0 8 0 0" Width="125" Height="22" VerticalAlignment="Top" />
            </Grid>
            <baseControls:BusyIndicator IsBusy="{Binding IsVeryBusy}" />
        </Grid>
    </Grid>
</Window>